{template 'common/header'}

<script type="text/javascript" src="../addons/meepo_newwxwall/template/jquery-1.7.2.min.js"></script>
<script>
	function selectall(obj, name){
		$('input[name="'+name+'[]"]:checkbox').each(function() {
			$(this).attr("checked", $(obj).attr('checked') ? true : false);
		});
	}
</script>

<div class="main panel panel-default" id="table-list">
	<div class="sub-title panel-heading">中奖名单</div>
	<div class="panel-body">
	<form action="" method="post" onsubmit="">
	<div class="sub-content table-responsive">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<!--<th style="width:50px;" class="row-first">选择</th>-->
					<th class="row-hover" style="width:100px;">微信昵称</th>
					<th class="row-hover">奖项</th>
					<th class="row-hover">奖品名称</th>
					<th class="row-hover">中奖时间</th>
					<th class="row-hover">领奖SN码</th>
					
					
				</tr>
			</thead>
			<tbody>
				{loop $list $row}
				<tr>
					<!--<td class="row-first"><input type="checkbox" name="select[]" value="{$row['id']}" /></td>-->
					<td class="row-hover">{$row['nickname']}<br><img src="{$row['avatar']}" height=40px width=40px /></td>
					<td class="row-hover">{$row['tag_name']}</td>
					<td class="row-hover">{$row['luck_name']}</td>
					<td style="font-size:12px; color:#666;">
						{php echo date('Y-m-d H:i:s', $row['createtime']);}
					</td>
					<td style="font-size:12px; color:#666;">
						{$row['createtime']}
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
		{if !empty($list)}
		<!--table class="table">
			<tr>
				<td style="width:40px;" class="row-first"><input type="checkbox" onclick="selectall(this, 'select');" /></td>
				<td>
					<input type="submit" name="delete" value="删除" class="btn btn-primary" />
					<input type="hidden" name="token" value="{$_W['token']}" />
				</td>
			</tr>
		</table-->
		{/if}
	</div>
	</form>
	</div>
	{$pager}
</div>

<script type="text/javascript">
require(['jquery'], function($){
	//详细数据相关操作
	var tdIndex;
	$("#table-list thead").delegate("th", "mouseover", function(){
		if($(this).find("i").hasClass("")) {
			$("#table-list thead th").each(function() {
				if($(this).find("i").hasClass("icon-sort")) $(this).find("i").attr("class", "");
			});
			$("#table-list thead th").eq($(this).index()).find("i").addClass("icon-sort");
		}
	});
	$("#table-list thead th").click(function() {
		if($(this).find("i").length>0) {
			var a = $(this).find("i");
			if(a.hasClass("icon-sort") || a.hasClass("icon-caret-up")) { //递减排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-down");
			} else if(a.hasClass("icon-caret-down")) { //递增排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-up");
			}
			$("#table-list thead th,#table-list tbody:eq(0) td").removeClass("row-hover");
			$(this).addClass("row-hover");
			tdIndex = $(this).index();
			$("#table-list tbody:eq(0) tr").each(function() {
				$(this).find("td").eq(tdIndex).addClass("row-hover");
			});
		}
	});
});
</script>
{template 'common/footer'}
